import tourlist from '../src/data/service/tourlist.json'
import servicelog from '../src/data/servicelog.json'
import chartlog from '../src/data/service/chatlog.json'



export default{
    "GET /getTourlist":tourlist.data,
    // 服务记录
    "GET /getServicelog":(req:any,res:any)=>{
        const {search}  = req.query
        if(search){
            const arr = servicelog.data.filter((item:any)=>{
                return item.kefu_name.includes(search)
            })
            res.send(arr)
        }else{
            res.send(
                servicelog.data
            )
        }
       
    },
    // 聊天记录
    "GET /chartLog":(req:any,res:any)=>{
        const {search}  = req.query
        if(search){
            const arr = chartlog.data.filter((item:any)=>{
                return item.from_name.includes(search)
            })
            res.send(arr)
        }else{
            res.send(
                chartlog.data
            )
        }
       
    },
}

